<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">

		<style type="text/css">
			canvas {
				border-style: solid;
				margin: 10px;
				height: 100%;
				width: auto;
			}
		</style>
	</head>

	<body>
		<a href="OCRAD_test.html">→ OCRAD方法.html</a>
		<br><hr>
		<h1 align="center">这是用的Tesseract.js</h1>
		<input type="file" onchange="load_file()" id="picker">
		<br>
		<canvas id="myCanvas"></canvas>
		<br>
		<div id="transcription"></div>
	</body>

	<script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.11/dist/tesseract.min.js'></script>
	<script src="../js/imgProcess.js" type="text/javascript"></script>
	<script type="text/javascript">
		
		//识别
		function ocrText(photo) {

			const worker = new Tesseract.TesseractWorker();
			worker
				.recognize(photo, 'chi_sim')
				.progress(function(message) {
					console.log(JSON.stringify(message))
				})
				.then(function(result) {
					console.log(result.text);
					document.getElementById("transcription").innerText = result.text;
				})
		}
	</script>


</html>
